<?php
namespace app\admin\model;
use think\Model;
use think\Db;

class Register extends Model
{
	public function register()
	{
		$file = request()->file('files');
		$info = $file->move("./uploads/");
		if($info){
			echo "头像上传成功";
		}else{
			echo $file->getError();
		}
		$img_path = $info->getSaveName();
		$data = \input("post.");
		$data["headimg"] = "/uploads/".$img_path;
		$res = Db::name("user")->insert($data);
		
		if($res&&$info){
			return true;
		}else{
			return false;
		}
	}
}
?>